#include <QApplication>
#include <QDesktopWidget>
#include "FrameWork.h"
#include "IVObject.h"
#include <iostream>
#include <Eigen/Dense>

#ifdef _DEBUG
#pragma comment(lib, "C:/Program Files (x86)/ode-0.12/lib/DebugDoubleDLL/ode_doubled.lib")
#pragma comment(lib, "C:/Program Files (x86)/libQGLViewer-2.3.17/QGLViewer/debug/QGLViewerd2.lib")
#else
#pragma comment(lib, "C:/Program Files (x86)/ode-0.12/lib/ReleaseDoubleDLL/ode_double.lib")
#pragma comment(lib, "C:/Program Files (x86)/libQGLViewer-2.3.17/QGLViewer/release/QGLViewer2.lib")
#endif

bool Macro::s_record = false;
bool Macro::s_mouseControl = false;
bool Macro::s_replay = false;
bool Macro::s_motorNoise = true;
bool Macro::s_sensorNoise = true;

double Macro::s_timeStep = 0.0;
Vector3d Macro::s_mousePos = Vector3d(0.0, 0.0, 0.0);

int Macro::s_replayIters = 5;
float Macro::s_mu1 = 14.32;
float Macro::s_mu2 = 4.2;

double Macro::s_gain = 5.0;
double Macro::s_maxForce = 500.0;

int main(int argc, char** argv)
{
	QApplication app(argc,argv);

    FrameWork frameWork;
	frameWork.resize(frameWork.sizeHint());
	int desktopArea = QApplication::desktop()->width() * QApplication::desktop()->height();
	int widgetArea = frameWork.width() * frameWork.height();
	if (((float)widgetArea / (float)desktopArea) < 0.75f)
		frameWork.show();
	else
		frameWork.showMaximized();

	//for (int i = 0; i < ivScene->Objects.getLength(); i++) 
	//{
	//	IVObject * obj = (IVObject *)ivScene->Objects[i];
	//	SoType shape_type = obj->shape->getTypeId();
	//	std::string name = shape_type.getName().getString();

	//	if (shape_type == SoFaceSet::getClassTypeId()) 
	//	{
	//		SoFaceSet* faceSet = (SoFaceSet *) obj->shape;
 //           int32_t t = faceSet->numVertices[1];
	//		int j = 1;
	//	}

	//	SoCoordinate3 *Ps = (SoCoordinate3 *)obj->points;
	//	SoMFVec3f r = Ps[0].point;
	//	SoNormal *sn = obj->normals;
	//	SoMFVec3f a = sn[0].vector;
	//}
	return app.exec();
}